package com.xdja.netty.learn.arpackage;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.FixedLengthFrameDecoder;

import java.util.List;

/**
 * description
 *
 * @author zk
 * @since 2018/7/25
 */
public class TailFixedLengthFrameDecoder extends FixedLengthFrameDecoder {
    /**
     * Creates a new instance.
     *
     * @param frameLength the length of the frame
     */
    public TailFixedLengthFrameDecoder(int frameLength) {
        super(frameLength);
    }

    @Override
    protected void decodeLast(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
        out.add(in);
    }
}
